<%@ page language="java" import="java.util.*" pageEncoding="utf-8" isELIgnored="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
 <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> 
 <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> 
 <%@ taglib prefix="s" uri="http://www.springframework.org/tags" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head> 
    <link rel="stylesheet" href="<s:url value="/resources"/>/css/common.css" type="text/css" />   
    <link rel="stylesheet" href="<s:url value="/resources"/>/css/innerstyle.css" type="text/css" />
    <link rel="stylesheet" type="text/css" media="screen" href="<s:url value="/resources"/>/css/cupertino/jquery-ui.custom.min.css" />
	<script type="text/javascript" src="<s:url value="/resources"/>/js/jquery-1.7.2.min.js"></script>
	<script type="text/javascript" src="<s:url value="/resources"/>/js/jquery-ui.custom.min.js"></script> 
	<script type="text/javascript" src="<s:url value="/resources"/>/js/jquery.form.js"></script>
	<script type="text/javascript" src="<s:url value="/resources"/>/js/json2.js"></script>
	<script type="text/javascript" src="<s:url value="/resources"/>/js/jquery.validate.min.js"></script>
	<script type="text/javascript" src="<s:url value="/resources"/>/js/messages_zh.js"></script>
	    <script type="text/javascript" src="<s:url value="/resources"/>/js/i18n/jquery.ui.datepicker-zh-CN.js"></script>
<style type="text/css">
	label.error {  
	        color: red;/*错误信息的颜色*/  
	    }  
	input.error {  
	        border:1px dotted red;/*输入错误的输入框的边框样式*/  
	    }	
</style>
<script type='text/javascript'>
	$(function(){ 
	    $("#but1").button();
	    $("#but3").button(); 
		$("#datepicker").datepicker($.datepicker.regional["zh-CN"]);
		$("#datepicker1").datepicker($.datepicker.regional["zh-CN"]);
	    jiaoyan();
     });
     

	//校验
	function jiaoyan()
	{
		   
		$.validator.addMethod("selectNone", 
		        function(value, element)
		        {   
		            if (value == "-1") 
		            {    
		                return false;    
		            }    
		            else    
		            {   
		                return true;    
		            }   
		        },    
		        "必须选择一项" 
		        ); 
	         $("#form1").validate({
			       rules: {
			    	   "bucxykssj":"required",
			    	   "bucxyjssj":"required"
			       },
				   messages: {
					   "bucxykssj":"请输入协议开始时间",
					   "bucxyjssj":"请输入协议结束时间"
				   }
			   });
	         $("#but1")
				.click(
						function() {
							if ($("#form1").valid()) {
								
								var flag = true;
								
								
								if (flag) {
									var url = "<s:url value="/"/>/htgl/modifyBcxy";
									$("#form1").ajaxSubmit({
										url : url,
										type : 'post',
										success : function(data) {
											var json = eval('(' + data + ')');
											if (json.result == 1) {
												alert("修改补充协议成功！");
												window.location.href="<s:url value="/htgl"/>/findBcxyView";
											}else if(json.result == 2){ 
												alert("合同号无效！");
											} else {
												alert("录入失败！");
											}
										}
									});
								} else {
									alert(msg);
								}
							}
						}); 
	}
	
	</script>
  </head>
  
 <body>
<div id="best1">
<h2><span>修改补充协议</span></h2>
<form name="form1" id="form1">
<input type="hidden" name="hetid" id="hetid" value="${bcxy.hetid}">
<input type="hidden" name="xieyid" id="xieyid"  value="${bcxy.xieyid}">
<input type="hidden" name="sysid" id="sysid" value="${bcxy.sysid}">
<table id="list_search" cellpadding="0" cellspacing="0" border="0">
		
		<tr>
		    <td>
            	合同编号:
            </td>
          <td colspan="5">
            	${bcxy.hetbh}
            </td>
  
        </tr>
  		<tr>
		    <td>
            	补充条款一:
            </td>
          <td colspan="5">
            	<textarea  cols="100" rows="4" name="buc1" class="textarea" >${bcxy.buc1}</textarea>    
            </td>
  
        </tr>
        
        <tr>
		    <td>
            	补充条款二:
            </td>
           <td colspan="5">
            	<textarea  cols="100" rows="4" name="buc2" class="textarea" >${bcxy.buc2}</textarea>    
            </td>
  
        </tr>
        
        <tr>
		    <td>
            	补充条款三:
            </td>
          <td colspan="5">
            	<textarea  cols="100" rows="4" name="buc3" class="textarea" >${bcxy.buc3}</textarea>    
            </td>
  
        </tr>
        
        <tr>
		    <td>
            	补充条款四:
            </td>
         <td colspan="5">
            	<textarea  cols="100" rows="4" name="buc4" class="textarea" >${bcxy.buc4}</textarea>    
            </td>
  
        </tr>
        
        <tr>
		    <td>
            	补充条款五:
            </td>
          <td colspan="5">
            	<textarea  cols="100" rows="4" name="buc5" class="textarea" >${bcxy.buc5}</textarea>    
            </td>
        </tr>
        
        <tr>
		    <td>
            	补充条款六:
            </td>
          <td colspan="5">
            	<textarea  cols="100" rows="4" name="buc6" class="textarea" >${bcxy.buc6}</textarea>    
            </td>
        </tr>
        
        <tr>
		    <td>
            	补充条款七:
            </td>
           <td colspan="5">
            	<textarea  cols="100" rows="4" name="buc7" class="textarea" >${bcxy.buc7}</textarea>    
            </td>
  
        </tr>
        
        <tr>
		    <td>
            	补充条款八
            </td>
            <td colspan="5">
            	<textarea  cols="100" rows="4" name="buc8" class="textarea" >${bcxy.buc8}</textarea>    
            </td>
  
        </tr>
       <tr>
		    <td>
            	协议开始时间：<span style="color: red;font-size:16px;vertical-align:middle;">*</span>
            </td>
            <td colspan="2">
            	<input name="bucxykssj" type="text" class="form-textbox" style="width: 193px;"  id="datepicker" value="${bcxy.bucxykssj}"/>   
            </td>
  			<td>
            	协议结束时间：<span style="color: red;font-size:16px;vertical-align:middle;">*</span>
            </td>
            <td colspan="2">
            	<input name="bucxyjssj" type="text" class="form-textbox" style="width: 193px;"  id="datepicker1" value="${bcxy.bucxyjssj}"/>
            </td>
        </tr>
      
        <tr>
		    <td colspan="6" align="center">	
		      
		            <input id="but1" type="button" value="保存" />&nbsp;&nbsp;&nbsp;
			      
			        <input id="but3" type="button" name="" value="返回" onclick="javascript:history.back();"/>
			    
		    </td>
        </tr>
  </table> 
</form>
</div> 
<div id="dialog-confirm" title="是否确认保存？"></div>
  </body>
</html>
